<template>
	<view class="container">
		<view class="detail_content">
			<u-cell-group>
				<u-cell size="large" title="本次抄表时间">
					<view slot="label">
						<text class="meter_no">{{currentReocrd.meterReadingTime}}</text>
					</view>
					<view slot="value">
						<u-tag v-if="currentReocrd.auditStatus===1" text="已通过" type="success"></u-tag>
						<u-tag v-if="currentReocrd.auditStatus===0" text="未审核" type="error"></u-tag>
					</view>
				</u-cell>
				<u-cell size="large" title="电流类型" :label="currentReocrd.currentTypeName || '—— ——'"></u-cell>
				<u-cell size="large" title="电流值" :label="currentReocrd.currentValue || '—— ——'"></u-cell>
				<u-cell size="large" title="电表度数" :label="currentReocrd.electricityBillDegree || '—— ——'"></u-cell>
				<u-cell size="large" title="本次用电量" :label="currentReocrd.electricityConsumption || '—— ——'"></u-cell>
				<u-cell size="large" title="本次PUE值" :label="currentReocrd.pueValue || '—— ——'"></u-cell>
				<u-cell size="large" title="业主未结"
					:label="currentReocrd.owCreate===1 ? '不可生成' : currentReocrd.ownerNot"></u-cell>
				<u-cell size="large" title="运营商未结"
					:label="currentReocrd.opCreate===1 ? '不可生成' : currentReocrd.operatorNot"></u-cell>
				<u-cell size="large" title="电流照片">
					<template #label>
						<u-album :urls="currentFiles"></u-album>
					</template>
				</u-cell>
				<u-cell size="large" title="电表照片">
					<template #label>
						<u-album :urls="meterFiles"></u-album>
					</template>
				</u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentReocrd: {},
				currentFiles: [],
				meterFiles: []
			}
		},
		onLoad(options) {
			if (options.data) {
				const data = JSON.parse(options.data)
				this.currentReocrd = data
				this.currentFiles = data.list.filter(i => i.fileType === '1').map(i => i.fileUrl)
				this.meterFiles = data.list.filter(i => i.fileType === '0').map(i => i.fileUrl)
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.container {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		padding: 20rpx;
		overflow: auto;

		.meter_no {
			font-size: 32rpx;
			font-weight: 700;
			color: #0050b3;
		}
	}
</style>